var URL = getRequestPrefix();

function myAjax(url, data, callback, errFn) {
    $.ajax({
        url: URL + url,
        type: 'get',
        data: data,
        dataType: 'json',
        success: function (data) {
            callback(data)
        },
        error: function (err) {
            errFn(err)
        }
    });
}

function getRequestPrefix() {
    return "http://newtest.sdfa.org.cn//footballAssociation"
    // 获取网络协议
    // 获取主机名+端口号
    var domainPort = window.location.host;
    // 获取发布项目的名称
    // 获取路径
    var url = window.location.pathname;
    var webApp = url.split('/')[1];
    // http://127.0.0.1/demo
    var urlPrefix = "http://" + domainPort + "/" + webApp;
    return urlPrefix;
}